#include <stdio.h>
#include <stdlib.h>

void merge(int *arr, int start, int mid, int end) {
    // qsort(arr + start, arr + end);
    int len = end - start + 1;
    int cpy[len];
    for (int i = start; i <= end; i++)
        cpy[i - start] = arr[i];
    int p1 = start, p2 = mid + 1, p3 = start;
    // printf("merge %d %d \n", start, end);
    while (p3 <= end) {
        if (p1 <= mid && (p2 > end || cpy[p1 - start] <= cpy[p2 - start])) {
            arr[p3++] = cpy[p1 - start];
            p1++;
        } else if (p2 <= end && (p1 > mid || cpy[p1 - start] > cpy[p2 - start])) {
            arr[p3++] = cpy[p2 - start];
            p2++;
        }
    }
}
void swap(int *a, int *b) {
    int t = *b;
    *b = *a;
    *a = t;
}
void mergeSort(int *arr, int start, int end) {
    if (start == end) return;
    if (end - start == 1) {
        if (arr[start] > arr[end]) swap(&arr[start], &arr[end]);
        return;
    }
    int mid = (start + end) / 2;
    mergeSort(arr, start, mid);
    mergeSort(arr, mid + 1, end);
    merge(arr, start, mid, end);
}

int main() {
    // length of array
    int n;
    scanf("%d", &n);

    // initial array
    int *arr = (int *)malloc(sizeof(int) * (n));
    for (int i = 0; i < n; i++)
        scanf("%d", arr + i);

    // sorting
    mergeSort(arr, 0, n - 1);

    // print array
    for (int i = 0; i < n; i++)
        printf("%d ", *(arr + i));

    free(arr);
    return 0;
}